# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.
#
# Old Maintainer: Jerome Leclanche <jerome@leclan.ch>

pkgname=dmg2img
pkgver=1.6.7
pkgrel=7
pkgdesc="A CLI tool to uncompress Apple's compressed DMG files to the HFS+ IMG format."
groups=('blackarch' 'blackarch-forensic' 'blackarch-misc')
arch=('x86_64' 'aarch64')
url='http://vu1tur.eu.org/tools/'
license=('GPL2')
depends=('openssl' 'bzip2')
source=("http://vu1tur.eu.org/tools/$pkgname-$pkgver.tar.gz"
        '0001-openssl-1.1-compatibility.patch')
sha512sums=('4c42841c5cdbf868b6038648a6c83e78d4b7f2010f7065d7b3f4c2c04d13af9489716c1dfa867aff5f3c3b3eef96dc3fc0610eff13fec139265f37f468e339e6'
            'd68964af346092d648b458c00b2383f22216cbdc908a0f940e17d9363c198a0fd52aebd00741c873cc122c476a06cb6baa81ac2160495e4be1a523c6e1462f02')

prepare() {
	cd "$pkgname-$pkgver"

	patch -Np1 --ignore-whitespace \
    -i "$srcdir/0001-openssl-1.1-compatibility.patch"
}

build() {
	cd "$pkgname-$pkgver"

	make PREFIX=/usr
}

package() {
	cd "$pkgname-$pkgver"

	make PREFIX=/usr DESTDIR="$pkgdir" install
}

